package com.ruoyi.web.controller.xcx;

import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.system.domain.AComment;
import com.ruoyi.system.service.IACommentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

import static com.ruoyi.common.core.domain.AjaxResult.success;

/**
 * 评论管理Controller
 *
 * @author system
 * @date 2025-02-23
 */
@RestController
@RequestMapping("/xcx/aComment")
public class XcxAComment {

    @Autowired
    private IACommentService aCommentService;

    /**
     * 查询评论管理列表
     */
    @GetMapping("/xcxList")
    public AjaxResult xcxList(AComment aComment) {
        List<AComment> list = aCommentService.selectACommentXcxList(aComment);
        return success(list);
    }


    /**
     * 点赞数加+1
     */
    @GetMapping("/likeNum/{id}")
    public AjaxResult likeNum(@PathVariable("id") Long id) {
        return success(aCommentService.updateACommentByLikeNum(id));
    }

}
